Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exists and Delete truncate -A <chain> from rulespec #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clarkwalcott
Copy link

Tool Version

iptables v1.8.7 (nf_tables)

Description

iptables Delete and Check commands both fail if the command includes -A. Since the rules returned from List have -A <chain> in them, using these rules as the rulespec fails if you don't strip out that prefix.

The purpose of this PR is to enable both types of rulespec to work for Delete and Check commands.

e.g.
Delete

[iptables -t filter -D <chain> -A <chain> -i <interface_name> -j ACCEPT --wait]: exit status 2: iptables v1.8.7 (nf_tables): Cannot use -A with -D\n\nTry `iptables -h' or 'iptables --help' for more information.

Check

[iptables -t filter -C <chain> -A <chain> -i <interface_name> -j ACCEPT  --wait]: exit status 2: iptables v1.8.7 (nf_tables): Cannot use -A with -C\n\nTry `iptables -h' or 'iptables --help' for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant